<div class="page-title">
  <h4>活动项目管理</h4>
  <a class="pull-right help-link">
    <i class="anticon anticon-question-circle-o"></i>活动项目管理
  </a>
</div>
<div class="table-top">
  <div class="table-operations clearfix ">
    <div class="pull-left">
      <app-apm-add (refreshData)="refreshData()" ></app-apm-add>
    </div>
    <div class="pull-right">
        <nz-select class="table-top-opt" [(ngModel)]="type" (ngModelChange)='onSearchtype()' nzShowSearch nzAllowClear nzPlaceHolder="请选择活动类型"  style="width: 200px;">
            <nz-option  [nzLabel]="'自驾游'" [nzValue]='1'></nz-option>
            <nz-option  [nzLabel]= "'跟随社团'" [nzValue]='2'></nz-option>
            <nz-option  [nzLabel]="'部门组织'" [nzValue]='3'></nz-option>
        </nz-select>
      <nz-input-group nzSearch [nzSuffix]="suffixIconButton">
        <input type="text" nz-input placeholder="请输入活动名称" [(ngModel)]="param">
      </nz-input-group>
      <ng-template #suffixIconButton>
        <button nz-button nzSearch (click)="searchFun()">
          <i class="anticon anticon-search"></i>
        </button>
      </ng-template>
      <button nz-button class="table-top-opt" (click)="refreshPage()">
        <i class="anticon anticon-reload"></i>
      </button>
    </div>
  </div>
</div>
<nz-table #nzTable [nzData]="dataSet" nzShowSizeChanger [nzFrontPagination]="false" [nzTotal]="_total"
          [nzLoading]="isLoading"
          [(nzPageIndex)]="_current" (nzPageIndexChange)="refreshData(false)" [(nzPageSize)]="_pageSize"
          (nzPageSizeChange)="refreshData(true)"
          [nzShowTotal]="rangeTemplate" nzBordered class="table-fixed"
          (nzCurrentPageDataChange)="currentPageDataChange($event)">
  <thead>
  <tr>
    <th nzWidth="35px" nzLeft="0px" nzShowCheckbox  [nzIndeterminate]="indeterminate"></th>
    <th nzWidth="130px">活动名称</th>
    <th>活动类别</th>
    <th>活动地点</th>
    <th nzWidth="150px">开始时间</th>
    <th nzWidth="150px">结束时间</th>
    <th>人均单价</th>
    <th>联系电话</th>
    <th>报名人数</th>
    <th nzRight="0px" nzWidth="20%" >操作</th>
  </tr>
  </thead>
  <tbody>
  <tr *ngFor="let data of nzTable.data">
    <td nzLeft="0px" nzShowCheckbox ></td>
    <td>{{data.active_name}}</td>
    <td *ngIf="data.active_type==1">自驾游</td>
    <td *ngIf="data.active_type==2">跟随社团</td>
    <td *ngIf="data.active_type==3">部门组织</td>
    <td>{{data.active_address}}</td>
    <td>{{data.begin_time | date:'yyyy-MM-dd HH:mm:ss'}}</td>
    <td>{{data.end_time | date:'yyyy-MM-dd HH:mm:ss'}}</td>
    <td>{{data.per_unit_price}}</td>
    <td>{{data.telephone}}</td>
    <td>{{data.applicant_number}}</td>
    <td nzRight="0px" class="table-opt" >
      <app-apm-update [rowData]="data" (refreshData)="refreshData()"></app-apm-update>
      <app-endpoint-opt [rowData]="data" (del)="del(data.id)"></app-endpoint-opt> 
      <!--<a routerLink="detail/{{data.id}}">修改</a>-->
    </td>
  </tr>
  </tbody>
  <ng-template #rangeTemplate let-range="range" let-total>
  </ng-template>
</nz-table>
